//package com.naiterui.ehp.bs.recommend.dao.impl;
//
//import java.util.Date;
//import java.util.List;
//
//import org.hibernate.criterion.DetachedCriteria;
//import org.hibernate.criterion.Restrictions;
//import org.springframework.stereotype.Repository;
//
//import com.naiterui.common.repository.hibernate.DefaultBaseDaoImpl;
//import com.naiterui.ehp.bs.recommend.bean.RecomAuditLog;
//import com.naiterui.ehp.bs.recommend.dao.IRecomAuditLogDao;
//
///**
// * @author guoyongxiang
// * @date 2019-06-20 15:33
// * @since 1.0.0
// */
//@Repository
//public class RecomAuditLogDaoImpl extends DefaultBaseDaoImpl<RecomAuditLog, Long> implements IRecomAuditLogDao {
//
//
//    @Override
//    public RecomAuditLog findByRecomId(Long recomId) {
//        List<RecomAuditLog> logs = super.find("from RecomAuditLog where recomId=?", recomId);
//        if (logs.size() > 0) {
//            return logs.get(0);
//        }
//        return null;
//    }
//
//    @Override
//    public List<RecomAuditLog> findByStatusAndPharmacistId(Integer status, Long pharmacistId, List<Long> recomId) {
//        DetachedCriteria criteria = this.createDetachedCriteria();
//        criteria.add(Restrictions.eq("status", status));
//        criteria.add(Restrictions.eq("pharmacistId", pharmacistId));
//        criteria.add(Restrictions.in("recomId", recomId));
//        return this.findByCriteria(criteria);
//    }
//
//    @Override
//    public List<RecomAuditLog> findByStatusAndPharmacistIdGreaterThanAndChangedAtBefore(Integer status, Long pharmacistId, Date changedAt, List<Long> recomId) {
//        DetachedCriteria criteria = this.createDetachedCriteria();
//        criteria.add(Restrictions.eq("status", status));
//        criteria.add(Restrictions.gt("pharmacistId", pharmacistId));
//        criteria.add(Restrictions.lt("changedAt", changedAt));
//        criteria.add(Restrictions.in("recomId", recomId));
//        return this.findByCriteria(criteria);
//    }
//}
